<?php
namespace App\Http\Validators;

use App\Http\Validators\AbstractValidator;

/*
 *
 * 列表接口
 */

class ProductValidator extends AbstractValidator
{

    /**
     * Validation rules
     *
     * @var Array
     */
    protected $rules = array(
        'min_algorithm' => ['required','integer'],
        'max_algorithm' => ['required','integer'],
        'min_cycle' => ['required','integer'],
        'max_cycle' => ['required','integer'],
        'pname' => ['required'],
        'Introduction' => ['required'],
         'fastest_time' => ['integer']
    );

    /**
     * Validation messages
     *
     * @var Array
     */
    protected $messages = array(
        'min_algorithm.required' => '最小利率必填',
        'min_algorithm.integer' => '最小利率必须为整数',
        'max_algorithm.required' => '最大利率必填',
        'max_algorithm.integer' => '最大利率必须为整数',
        'min_cycle.required' => '最小周期必填',
        'min_cycle.integer' => '最小周期必须为整数',
        'max_cycle.required' => '最大周期必填',
        'max_cycle.integer' => '最大周期必须为整数',
        'pname.required' => '产品名称必填',
        'Introduction.required' => '产品简介必填',
        'fastest_time.integer' => '官方时间必须为整数',

    );


//    public function before()
//    {
//        //自定义规则检查用户手机号
//        $this->extend('is_compare',function($attribute,$value,$paramters){
//            if ()) {
//                return true;
//            } else {
//                return false;
//            }
//        });

}
